// import service from "@/utils/request";
import xjaxiosOnline from "@/api/axios";
// import zhreq from "@/api/axios";
export default {
  /**
   * @description: 用户登录
   * @param {String} account
   * @param {String} password
   * @return {Object}
   */
  login(params) {
    // return xjaxiosOnline.post("/oauth/oauth/login", {
    //   account: params.account,
    //   password: params.password
    // });
    return xjaxiosOnline.post("/config/omUser/login", {
      // account: params.account,
      // password: params.password
      ...params
    });
  },
  /**
   * @description: 查顶级组织公司结构数据，返回为公司列表
   * @return {Object}
   */
  organizationTop() {
    return xjaxiosOnline.get("/oa/oauth/getCompany", {
    });
  },
  /**
   * @description: 获取农场列表
   * @param {String} companyId
   * @return {Array}
   */
  farmListbyOrganizationId(params) {
    return xjaxiosOnline.get(
      `/oa/oauth/getSuborganization/${params}`);
  },
  /**
   * @description: 获取获取树状列表
   * @param {String} organizationtId
   * @return {Array}
   */
  gettreelist(params) {
    return xjaxiosOnline.get(`/organizationManage/organization/loginChildel/${params}`)
  },
  gettreeslist(params) {
    return xjaxiosOnline.get(`/organizationManage/organization/queryTreeList/${params}`)
  },
  /**
   * @description: 通过id获取子节点列表
   * @param {String} organizationtId
   * @return {Array}
   */
  getchildidlist(params) {
    return xjaxiosOnline.get(`/organizationManage/organization/queryIdList/${params}`)
  },
  /**
   * @description: 通过数据库名字
   * @param {String} organizationtId
   * @return {Array}
   */
  getdatabasename(params) {
    return xjaxiosOnline.get(`/organizationManage/organizationDatabaseMapper/queryByOrgId/${params}`)
  },
  /**
   * @description: 获取设施组-所有
   * @param {String} organizationtId
   * @return {Array}
   */
  getFacilityGroup() {
    return xjaxiosOnline.post(`/facilityManage/facilityGroup/queryAllByOrgIdList`, {
      farmingTypeId: sessionStorage.getItem('farmtypeid'),
      organizationIdList: sessionStorage.getItem("organizationList").split(','),
      facilityStatus: 1
    })
  },
  /**
   * @description: 获取设施组id查地块-所有
   * @param {String} organizationtId
   * @return {Array}
   */
  getdikuaiGroup(param) {
    return xjaxiosOnline.get(`facilityManage/facilityGroupMapper/queryByFacilityGroupId/${param}`)
  },
  /**
   * @description: 直接获取所有地块
   * @param {String} organizationtId
   * @return {Array}
   */
  getfacilityAll(params) {
    return xjaxiosOnline.post("facilityManage/facility/queryByCondition", params)
  },
  // ----注册相关----
  /**
   * @description: 获取组织结构树状图
   */
  getcompanyregist() {
    return xjaxiosOnline.get("organizationManage/organization/queryTreeList/0")
  },
  /**
   * @description: 用户上传信息
   */
  registuser(params) {
    return xjaxiosOnline.post("oa/oauth/addReviewUser", {
      expired: false,
      systemIdStr: "OM1-SC",
      ...params
    })
  },
  /**
   * @description: 获取组织结构树状图
   */
  gettodapingurl() {
    return xjaxiosOnline.post("organizationManage/driveOrgnizationMapper/queryByCondition", {
      organizationId: sessionStorage.getItem('organizationId')
    })
  }
};
